//package com.tqjc.system.core.redis;
//
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary;
//import org.springframework.data.redis.cache.RedisCacheManager;
//import org.springframework.data.redis.connection.RedisConnectionFactory;
//import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
//import org.springframework.data.redis.connection.jedis.JedisClientConfiguration;
//import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
//import org.springframework.data.redis.core.RedisTemplate;
//import org.springframework.data.redis.serializer.StringRedisSerializer;
//import redis.clients.jedis.JedisPoolConfig;
//
//import javax.annotation.Resource;
//
///**
// * @Description: TODO
// * @author: pzy
// * @date: 2022年05月05日 10:56
// */
//@Configuration
//public class TaskRedisConfig extends RedisConfig{
//
////    @Value("${spring.redis2.database}")
////    private int dbIndex;
//
//    @Value("${spring.redis2.host}")
//    private String host;
//
//    @Value("${spring.redis2.port}")
//    private int port;
//
//    public JedisConnectionFactory redisConnectionFactoryForTask() {
//        RedisStandaloneConfiguration redisStandaloneConfiguration = new RedisStandaloneConfiguration();
//        redisStandaloneConfiguration.setHostName(host);
//        redisStandaloneConfiguration.setPort(port);
//        return new JedisConnectionFactory(redisStandaloneConfiguration);
//    }
//    /**
//     * 配置redisTemplate 注入方式使用@Resource(name="") 方式注入
//     *
//     * @return
//     */
//    @Resource(name = "taskRedisTemplate")
//    public RedisTemplate TaskRedisTemplateForTask() {
//        RedisTemplate<String, Object> template = new RedisTemplate();
//        template.setConnectionFactory(redisConnectionFactoryForTask());
//        setSerializer(template);
//        template.afterPropertiesSet();
//        return template;
//    }
//
//
//}
